package me.zk.practice1.s;

import me.zk.practice1.TreeNode;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: zhang kai
 * @Date: 2023/06/13
 * @Description:
 */
public class S19 {

    public static void main(String[] args) {

    }

    public List<Integer> inorderTraversal(TreeNode root) {
      List<Integer> list = new ArrayList<>();
      get(list,root);
      return list;
    }

    public void get(List<Integer> list,TreeNode n) {
        if (n==null){
            return;
        }
        get(list,n.left);
        list.add(n.val);
        get(list,n.right);
    }

}
